<template>
	<view class="container">
		<view class="carousel">
			<swiper indicator-dots circular=true duration="400">
				<swiper-item class="swiper-item" v-for="(item,index) in detail.lsAlbums" :key="index">
					<view class="image-wrapper">
						<image :src="item.cFolder" class="loaded" mode="widthFix"></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="activity-box">
			<view class="left">
				<text class="activity-name">{{detail.groupBuying.name}}</text>
				<text class="price">￥{{detail.fSalePrice}}</text>
			</view>
			<view class="right">
				<text class="activity-desc">距结束 {{times}} </text>
				<view class="stock-box">
					<text class="total-num">
						<text class="now-num" :style="{width:detail.lInventoryCount/(detail.lInventoryCount+detail.iSales)*100+'%'}"></text>
					</text>
					<text class="justRemnant">仅剩{{detail.lInventoryCount}}件</text>
				</view>
			</view>
		</view>


		<view class="introduce-section">


			<view class="i-header">
				<text class="tit clamp">{{detail.cName}}<text>推荐理由</text></text>
				<text class="tip" @click="comment">98% <text>好评率</text></text>
				<text class="yticon icon-you"></text>
			</view>
			<view class="desc">
				<text>{{detail.cTitleMemo}}</text>
				<image src="/static/img/1/107.png" mode="scaleToFill"></image>
			</view>
		</view>
		<view class="ping" @click="toer">
			<view class="h2">
				还差{{detail.groupBuying.peopleNumber-detail.groupBuying.purchasedProductQuantity}}人拼团成功，仅剩 {{times}}
			</view>
			<view class="pingk">
				<view class="top">
					<view class="kbox">
						<view class="tito">
							团长
						</view>
						<view class="topk">
							<image src="/static/img/2/2-5.png" mode="scaleToFill"></image>
						</view>
					</view>
					<view class="kbox">
						<view class="topk">
							<image src="/static/img/2/2-5.png" mode="scaleToFill"></image>
						</view>
					</view>
				</view>
				<view class="ps">
					开团后可邀请好友
				</view>
				<view class="gank">

					<view class="ga">
						<image src="/static/img/1/face1.png" mode="widthFix"></image>
						<text>发起拼团</text>
					</view>
					<view class="bb"></view>
					<view class="ga">
						<image src="/static/img/1/face1.png" mode="widthFix"></image>
					</view>
					<view class="bb"></view>
					<view class="ga">
						<image src="/static/img/1/face1.png" mode="widthFix"></image>
						<image src="/static/img/1/face2.png" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>

		<view class="c-list">

			<!-- <view class="c-row b-b">
				<text class="tit">服务说明</text>
				<view class="radio-box">
					<label class="radio">
						<radio value="r1" color="#FA436A" checked="true" />无忧退货</label>
					<label class="radio">
						<radio value="r2" color="#FA436A" checked="true" />快速退款</label>
					<label class="radio">
						<radio value="r3" color="#FA436A" checked="true" />免费包邮</label>
				</view>
			</view>
			<view class="c-row b-b">
				<text class="tit">购物返</text>
				<view class="con-list">
					<text>新用户最高返 <text>￥3元+5积分</text></text>

				</view>
			</view> -->
			<view class="c-row b-b" @click="toggleSpec">
				<text class="tit">已选</text>
				<view class="con">
					<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">
						{{sItem.cSpecItemName}}
					</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
			<view class="c-row b-b">
				<text class="tit">配送</text>
				<view class="con">

					<picker @change="bindPickerChange" :value="current" :range="array" class="picker">
						<view class="uni-input">{{array[current]}}</view>
					</picker>

				</view>
				<text class="yticon icon-you"></text>
			</view>
		</view>

		<!-- 品牌信息 -->
		<view class="introduce-section">
			<view class="pinpai">
				<view class="s-header">
					<text class="title">品牌信息</text>
					<text class="right" @click="pinpai">更多+</text>

				</view>
				<view class="pinpai-box">
					<image :src="bradnInfo.brandLogo" mode="aspectFit"></image>
					<view class="text-title">
						<text class="text-large">{{bradnInfo.name}}</text>
						<text class="text-small">{{bradnInfo.randKeywords}}</text>
					</view>
				</view>

			</view>
		</view>

		<!-- 评价 -->
		<view class="eva-section">
			<view class="e-header">
				<text class="tit">用户好评</text>
				<text>(520)</text>
				<text class="tip"><text>100%</text> 好评率</text>
				<!-- <text class="yticon icon-you"></text> -->
			</view>
			<view class="eva-box">
				<image class="portrait" src="http://img3.imgtn.bdimg.com/it/u=1150341365,1327279810&fm=26&gp=0.jpg" mode="aspectFill"></image>
				<view class="right">
					<text class="name">Leo yo</text>
					<text class="level">铂金</text>

				</view>
			</view>
			<view class="size">
				<view class="bot">
					<text class="attr">2019.08.26 菲律宾香蕉（2K）</text>
					<!-- <text class="time">2019-04-01 19:21</text> -->
				</view>
				<text class="con">商品收到了，79元两件，质量不错，试了一下有点瘦，但是加个外罩很漂亮，我很喜欢</text>

			</view>
			<view class="image-box">
				<image src="/static/img/1/12.png"></image>
				<image src="/static/img/1/12.png"></image>
				<image src="/static/img/1/12.png"></image>
				<image src="/static/img/1/12.png"></image>
			</view>
		</view>

		<!-- 猜你喜欢 -->
		<view class="seckill-section m-t">
			<view class="s-header">
				<text class="title">猜你喜欢</text>
				<text class="right">更多+</text>

			</view>
			<scroll-view class="floor-list" scroll-x>
				<view class="scoll-wrapper">
					<view v-for="(item, index) in goodsList" :key="index" class="floor-item" @click="navToDetailPage(item)">
						<image :src="item.image" mode="aspectFill"></image>
						<text class="new">新品上市</text>
						<text class="title clamp">{{item.title}}</text>
						<text class="price"><text class="unit">￥</text>{{item.price}}</text>
					</view>

				</view>
			</scroll-view>
		</view>

		<!--产品溯源-->
		<view class="seckill-section m-t">
			<view class="s-header">
				<text class="title">产品溯源</text>
				<text class="right" @click="toTrace">更多+</text>

			</view>

		</view>

		<!-- 详情 -->
		<view class="detail-desc">
			<view class="d-header">
				<text>图文详情</text>
			</view>
			<rich-text :nodes="detail.mobileDescription"></rich-text>
		</view>

		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<navigator url="/pages/inner/shopindex" open-type="navigate" class="p-b-btn">
				<image src="/static/img/1/64.png"></image>
				<!-- <text class="yticon icon-xiatubiao--copy"></text> -->
				<!-- <text>首页</text> -->
			</navigator>
			<navigator url="/pages/cart/cart" open-type="switchTab" class="p-b-btn">
				<image src="/static/img/1/50.png"></image>
				<!-- <text class="yticon icon-gouwuche"></text> -->
				<!-- <text>购物车</text> -->
			</navigator>
			<view class="p-b-btn" :class="{active: favorite}" @click="toFavorite">
				<image src="/static/img/1/69.png"></image>
				<!-- <text>收藏</text> -->
			</view>

			<view class="action-btn-group">
				<button type="primary" class=" action-btn no-border buy-now-btn" @click="nowbuy"><text>￥{{detail.groupBuying.price}}</text><text>原价购买</text></button>
				<button type="primary" class=" action-btn no-border add-cart-btn buy-now-btn" @click="nowbuy"><text>￥{{detail.groupBuying.price}}</text><text>我要开团</text></button>
			</view>
		</view>


		<!-- 规格-模态层弹窗 -->
		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content" @click.stop="stopPrevent">
				<view class="a-t">
					<image v-for="(item,imageitem) in detail.lsSpecItemAlbums" v-if="iSpecItemId === item.iSpecItemId" :src="item.imgUrl"
					 :key='imageitem'></image>
					<view class="right">
						<text class="price" v-for="(item,sIndex) in detail.lsProductSkus" v-if="lsProductSkusStr == item.cSpecIds" :key="sIndex+1">¥{{item.fSalePrice}}</text>
						<uni-number-box v-for="(item,sIndex) in detail.lsProductSkus" v-if="lsProductSkusStr == item.cSpecIds" :key="sIndex+5"
						 class="step" :min="1" :max="item.lInventoryCount" :value="1" :index="1" @eventChange="numberChange"></uni-number-box>
						<text class="stock" v-for="(item,sIndex) in detail.lsProductSkus" v-if="lsProductSkusStr == item.cSpecIds" :key="sIndex+2">库存：{{item.lInventoryCount}}{{item.cSKUModelDescription}}</text>
						<view class="selected">
							已选：
							<text class="selected-text" v-for="(sItem, sIndex) in specSelected" :key="sIndex">
								{{sItem.cSpecItemName}}
							</text>
						</view>
					</view>
				</view>
				<view v-for="(item,index) in specList" :key="index" class="attr-list">
					<text>{{item.cName}}</text>
					<view class="item-list">
						<text v-for="(childItem, childIndex) in item.lsSpecItem" :key="childIndex" class="tit" :class="{selected: childItem.selected}"
						 @click="selectSpec(childIndex, childItem.id)">
							{{childItem.cSpecItemName}}
						</text>
					</view>
				</view>
				<button class="btn" @click="toggleSpec">完成</button>
			</view>
		</view>
		<!-- 分享 -->
		<share ref="share" :contentHeight="900" :shareList="shareList"></share>

	</view>
</template>

<script>
	import share from '@/components/share';
	import uniNumberBox from '@/components/uni-number-box.vue'
	export default {
		components: {
			share,
			uniNumberBox
		},
		data() {
			return {
				specClass: 'none',
				specSelected: [],

				favorite: true,
				shareList: [],
				detail: {
					promotion: {
						sDesName: ''
					},
					groupBuying: {
						name: '',
						peopleNumber: 0,
						purchasedProductQuantity: 0

					}
				},
				goodsList: [],
				imgList: [],
				desc: `
					<div style="width:100%">
						<img style="width:100%;display:block;" src="/magicdd/static/img/8/1.png" />
						<img style="width:100%;display:block;" src="/magicdd/static/img/8/2.png" />
						<img style="width:100%;display:block;" src="/magicdd/static/img/8/3.png" />
						<img style="width:100%;display:block;" src="/magicdd/static/img/8/4.png" />
						<img style="width:100%;display:block;" src="/magicdd/static/img/8/5.png" />
					</div>
				`,
				specList: [

				],
				specChildList: [],
				lsProductSkusStr: '',
				current: 0,
				array: ["线上", "线下"],
				commonList: [],
				iSKUId: '',
				onLineOffLine: 0,
				iQuantity: 1,
				iSpecItemId: '',
				brandId: '',
				productClass: '',
				timer: null,
				times: "--天--:--:--",
				bradnInfo: {}
			};
		},
		async onLoad(options) {

			//接收传值,id里面放的是标题，因为测试数据并没写id
			let id = options.id;

			if (id) {
				this.$Request.get(this.$api.httpApi.goods.iteminfo + '&id=' + id + '&token=' + this.$SysCache.get('token')).then(
					res => {
						if (res.code == 200) {
							console.log(res.data)
							this.detail = res.data
							this.brandId = res.data.brandId
							this.productClass = res.data.productClass
							this.specList = res.data.lsSpecs
							this.timeDown()
							//规格 默认选中第一条
							this.specList.forEach(item => {

								for (let [index, cItem] of new Map(item.lsSpecItem.map((cItem, index) => [index, cItem]))) {
									this.specChildList.push(cItem)
									if (index === 0) {
										this.$set(cItem, 'selected', true);
										this.specSelected.push(cItem);
										// break; //forEach不能使用break
									}
								}


							})
							let arr = []
							this.specSelected.forEach(item => {
								arr.push(item.id)
								this.iSpecItemId = item.id
							})
							this.lsProductSkusStr = arr.join(";")
							this.detail.lsProductSkus.forEach(item => {
								if (item.cSpecIds == this.lsProductSkusStr) {
									this.detail.fSuggestedPrice = item.fSuggestedPrice
									this.detail.fSalePrice = item.fSalePrice
									this.iSKUId = item.id
									// this.detail.cTitleMemo = item.cSpecDescription
								}
							})



							this.$Request.post4(
								this.$api.httpApi.cate.brand, {
									"brand_id": this.detail.brandId
								}
							).then(res => {
								if (res.code == 1) {
									this.bradnInfo = res.data[0]



								}
							})

						}
					})

				this.$Request.get(this.$api.httpApi.goods.Comments +
					'&productID=' + id + '&type=20' + '&commentStatus=0' + '&pageIndex=1' + '&pageSize=2' + '&isFront=true' +
					'&startLevel=null' + '&token=' + this.$SysCache.get('token')).then(res => {
					if (res.code == 200) {
						this.commonList = res.data
					}
				})
			}


			this.shareList = await this.$api.json('shareList');
		},
		methods: {
			//规格弹窗开关
			toggleSpec() {
				if (this.specClass === 'show') {
					this.specClass = 'hide';
					setTimeout(() => {
						this.specClass = 'none';
					}, 250);
				} else if (this.specClass === 'none') {
					this.specClass = 'show';
				}
			},
			//选择规格
			selectSpec(index, pid) {
				let list = []
				this.iSpecItemId = pid
				this.specList.forEach((item, i) => {
					for (let [indexs, cItem] of new Map(item.lsSpecItem.map((cItem, indexs) => [indexs, cItem]))) {
						if (cItem.id === pid) {
							this.specList[i].lsSpecItem.forEach(items => {
								this.$set(items, 'selected', false);
							})

							this.$set(cItem, 'selected', true);
						}
						list.push(cItem)



					}
				})



				//存储已选择
				/**
				 * 修复选择规格存储错误
				 * 将这几行代码替换即可
				 * 选择的规格存放在specSelected中
				 */
				this.specSelected = [];
				list.forEach(item => {
					if (item.selected === true) {
						this.specSelected.push(item);
					}
				})
				let arr = []
				this.specSelected.forEach(item => {
					arr.push(item.id)
				})
				this.lsProductSkusStr = arr.join(";")
				this.detail.lsProductSkus.forEach(item => {
					if (item.cSpecIds == this.lsProductSkusStr) {
						this.detail.fSuggestedPrice = item.fSuggestedPrice
						this.detail.fSalePrice = item.fSalePrice
						this.iSKUId = item.id
						// this.detail.cTitleMemo = item.cSpecDescription
					}
				})

			},
			//选择配送方式
			bindPickerChange: function(e) {
				console.log('picsker发送选择改变，携带值为', e.target.value)
				this.current = e.target.value
			},
			//数量
			numberChange(data) {
				// console.log(data.number);
				this.iQuantity = data.number
			},
			//评论
			comment() {
				uni.navigateTo({
					url: `/pages/detail/comment`
				})
			},
			//溯源
			toTrace() {
				uni.navigateTo({
					url: `/pages/detail/trace`
				})
			},
			//分享
			share() {
				this.$refs.share.toggleMask();
			},
			//收藏
			toFavorite() {
				let datas = {
					"iShopIds": '',
					"ids": this.detail.id,
					"token": this.$SysCache.get('token') || null,
				}

				this.$Request.post(this.$api.httpApi.goods.addProductFavorite + "&token=" + this.$SysCache.get('token'), datas).then(
					res => {
						if (res.code == 200) {
							uni.showToast({
								title: res.message,
								duration: 2000
							})
						}
					})


				this.favorite = !this.favorite;
			},
			buy() {
				let datas = [{
					"iSKUId": this.iSKUId,
					"iProductId": this.detail.id,
					"onLineOffLine": this.current,
					"iQuantity": this.iQuantity,
					"dlyType": "PICKUP"
				}]

				let obj = {
					"items": JSON.stringify(datas)
				}

				this.$Request.post(this.$api.httpApi.goods.addCarts + "&token=" + this.$SysCache.get('token'), obj).then(res => {
					if (res.code == 200) {
						uni.showToast({
							title: res.message,
							duration: 2000
						})
					}
				})
			},
			nowbuy() {
				let datas = {
					"iSKUId": this.iSKUId,
					"iProductId": this.detail.id,
					"onLineOffLine": this.current,
					"iQuantity": this.iQuantity,
					"dlyType": "PICKUP"
				}


				let obj = {
					"item": datas
				}

				this.$Request.post(this.$api.httpApi.goods.orderNow + "&token=" + this.$SysCache.get('token'), obj).then(res => {
					if (res.code == 200) {
						let cardata = [{
							"iSKUId": this.iSKUId,
							"iProductId": this.detail.id,
							"onLineOffLine": this.current,
							"iQuantity": this.iQuantity,
							"dlyType": "PICKUP",
							"id": res.data
						}]
						let subdata = {
							"items": cardata,
							"realProductAttribute": 1,
							"wayOfOrder": 1
						}
						this.$Request.post(this.$api.httpApi.car.GenerateOrderByShoppingCart + "&token=" + this.$SysCache.get('token'),
							subdata).then(resq => {
							if (resq.code == 200) {
								uni.navigateTo({
									url: `/pages/order/order`
								})

							}
						})

					}
				})
			},
			pinpai() {
				uni.navigateTo({
					// url: `/pages/brand/detial?brandClass='+ this.productClass+'&brand_id=`+this.brandId,
					// url: '/pages/brand/detial?brandClass='+this.productClass+'&brand_id='+this.brandId,
					url: '/pages/brand/index?brandClass=' + this.productClass + '&brand_id=' + this.brandId,
				})
			},
			stopPrevent() {},
			timeDown() { // 倒计时

				clearInterval(this.timer);
				var starttime = new Date(this.detail.groupBuying.startTime.replace(/-/g, "/")) / 1000;
				var nowDate = Math.round(new Date() / 1000); // 当前时间
				//var endtime = Number(this.initActiveMsgObj.end_time); 
				var endtime = new Date(this.detail.groupBuying.endTime.replace(/-/g, "/")) / 1000;
				// endtime = Math.round(new Date('2019/7/10 14:56:00') / 1000); + 60;
				if (endtime < nowDate) {
					return
				}


				var totalSeconds = parseInt((endtime - nowDate)); // 相差的总秒数
				//天数
				var days = Math.floor(totalSeconds / (60 * 60 * 24));
				//取模（余数）
				var modulo = totalSeconds % (60 * 60 * 24);
				//小时数
				var hours = Math.floor(modulo / (60 * 60));
				hours = hours < 10 ? ('0' + hours) : hours;
				modulo = modulo % (60 * 60);
				//分钟
				var minutes = Math.floor(modulo / 60);
				minutes = minutes < 10 ? '0' + minutes : minutes;
				// console.log(minutes)
				//秒
				var seconds = modulo % 60;
				seconds = seconds < 10 ? '0' + seconds : seconds;
				// console.log(seconds);
				//输出到页面
				this.times = days + '天' + hours + ':' + minutes + ':' + seconds;
				// console.log(days + "天" + hours + "时" + minutes + "分");
				//if(totalSeconds <= 0){
				if (totalSeconds <= 60) {
					clearInterval(this.timer);
					// window.location.reload()
				} else {
					this.timer = setInterval(this.timeDown, 1000);
				}
			},
		},
		onNavigationBarButtonTap(e) {
			// console.log(e)
			if (e.type === "share") {
				this.$refs.share.toggleMask();
			} else {
				uni.switchTab({
					url: `/pages/index/index`
				})
			}

		}

	}
</script>

<style lang='scss'>
	.pingk {
		padding: 30rpx;
		text-align: center;
	}

	.gank {
		width: calc(524rpx + 80rpx);
		margin: auto;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(240, 64, 111, 1);
		margin-top: 30rpx;
		position: relative;
		padding-bottom: 45rpx;
		/* line-height: 40rpx; */
	}

	.gank .ga {
		display: inline-block;
		position: relative;
		vertical-align: middle;

	}

	.gank .ga text {
		display: block;
		position: absolute;
		top: 50rpx;
		width: 100rpx;
		left: -30rpx;
		margin: auto;
	}

	.gank .bb {
		width: 220rpx;
		display: inline-block;
		height: 1px;
		background: #F0406F;
		vertical-align: middle;
	}

	/* .gank .ga:nth-child(1){
		text-align: left;
	}
	.gank .ga:nth-child(3){
		text-align: right;
	} */
	.gank image {
		display: inline-block;
		vertical-align: middle;
		width: 40rpx;
		height: 40rpx;
	}

	.pingk .ps {
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		margin-top: 15rpx;
	}

	.pingk .kbox {
		width: 105rpx;
		display: inline-block;
		vertical-align: bottom;
		margin-left: 7rpx;
		margin-right: 7rpx;
	}

	.pingk .kbox .tito {
		display: block;
		margin: auto;
		width: 56rpx;
		height: 23rpx;
		background: rgba(240, 64, 111, 1);
		border-radius: 12rpx;
		text-align: center;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
		line-height: 23rpx;
		margin-bottom: 10rpx;
	}

	.pingk .topk {
		display: block;
		vertical-align: middle;
		width: 105rpx;
		height: 105rpx;
		border: 1px dashed rgba(240, 64, 111, 1);
		border-radius: 50%;
		overflow: hidden;
	}

	.pingk .topk image {
		display: block;
		width: 100%;
	}

	.ping {
		margin-top: 10rpx;
		margin-bottom: 10rpx;
		background: #fff;
	}

	.ping .h2 {
		height: 60rpx;
		background: rgba(240, 64, 111, 1);
		text-align: center;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
		line-height: 60rpx;
	}

	.ping .h2 text {
		display: inline-block;
		width: 28rpx;
		height: 28rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 14rpx;
		text-align: center;
		line-height: 28rpx;
		font-size: 18rpx;
		color: #F0406F;
		margin-left: 5rpx;
	}

	page {
		background: $page-color-base;
		padding-bottom: 160upx;
	}

	.m-t {
		margin-top: 20upx;
	}

	.icon-you {
		font-size: $font-base + 2upx;
		color: #888;
	}

	.carousel {
		height: 722upx;
		position: relative;

		swiper {
			height: 100%;
		}

		.image-wrapper {
			width: 100%;
			height: 100%;
		}

		.swiper-item {
			display: flex;
			justify-content: center;
			align-content: center;
			height: 750upx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}

	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;
		padding: 20upx 30upx;

		.i-header {
			display: flex;
			align-items: center;
			/* height: 70upx; */
			font-size: $font-sm + 2upx;
			color: $font-color-light;
			margin-top: 42upx;

			.tit {
				font-size: 31upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(51, 51, 51, 1);
				margin-right: 4upx;
				line-height: 40upx;
				width: 80%;

				text {
					display: block;
					font-size: 23upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(102, 102, 102, 1);
					line-height: 40upx;
				}
			}

			.tip {
				flex: 1;
				text-align: right;
				font-size: 29upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(77, 200, 151, 1);
				line-height: 40upx;

				text {
					display: block;
					font-size: 23upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(102, 102, 102, 1);
					line-height: 40upx;
				}
			}

			.icon-you {
				margin-left: 10upx;
			}
		}

		.desc {
			background: rgba(240, 240, 240, 0);
			/* border:1px solid rgba(200, 200, 200, 1);
			border-radius:10px; */
			padding: 40upx 30upx;
			position: relative;
			margin-top: 11upx;

			image {
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				width: 100%;
				height: 100%;
			}

			text {
				font-size: 21upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(102, 102, 102, 1);
				line-height: 33upx;
			}
		}

		.pinpai {
			.s-header {
				display: flex;
				align-items: center;
				height: 92upx;
				line-height: 1;
				border-bottom: 2upx solid #f5f5f5;

				.title {
					font-size: 31upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(102, 102, 102, 1);
					;
				}

				.right {
					font-size: 21upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(130, 130, 130, 1);
					flex: 1;
					text-align: right;

				}


			}

			.pinpai-box {
				display: flex;
				justify-content: flex-start;
				align-items: center;
				height: 250upx;

				image {
					width: 120upx;
					height: 120upx;
					border-radius: 50%;
					border: 15upx solid #999;
					margin-right: 30upx;
				}

				.text-title {
					flex: 1;

					text {
						display: block;
					}

					.text-large {
						font-size: 31upx;
						font-family: Microsoft YaHei;
						font-weight: 400;
						color: #444;
						line-height: 38upx;
					}

					.text-small {
						font-size: 21upx;
						font-family: Microsoft YaHei;
						font-weight: 400;
						color: rgba(136, 136, 136, 1);
						line-height: 35upx;
					}
				}
			}

		}

		.full {
			display: flex;
			justify-content: flex-start;
			margin-top: 45upx;

			.f-header {
				width: 64upx;
				height: 64upx;
				background: rgba(235, 74, 105, 1);
				border-radius: 32upx;
				font-size: 20upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 254, 254, 1);
				display: flex;
				justify-content: center;
				align-items: center;
				margin-right: 15upx;
			}


			.text-title {
				text {
					display: block;
				}

				.text-large {
					font-size: 23upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(102, 102, 102, 1);
					line-height: 38upx;
				}

				.text-small {
					font-size: 17upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(136, 136, 136, 1);
					line-height: 25upx;
				}
			}
		}

		.price-box {
			display: flex;
			align-items: baseline;
			height: 64upx;
			padding: 10upx 0;
			font-size: 26upx;
			color: $uni-color-primary;
		}

		.price {
			font-size: 51upx;
		}

		.m-price {
			margin: 0 12upx;
			color: $font-color-light;
			text-decoration: line-through;
			font-size: 27upx;
		}

		.coupon-tip {
			align-items: center;
			padding: 6upx 18upx;
			border: 2upx solid rgba(77, 200, 151, 1);
			border-radius: 17upx;
			line-height: 1;
			transform: translateY(-4upx);
			font-size: 25upx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: rgba(77, 200, 151, 1);

		}

		.bot-row {
			display: flex;
			align-items: center;
			height: 50upx;
			font-size: $font-sm;
			color: $font-color-light;

			text {
				flex: 1;
			}
		}
	}


	.c-list {
		font-size: $font-sm + 2upx;
		color: $font-color-base;
		background: #fff;

		.c-row {
			display: flex;
			align-items: center;
			padding: 20upx 30upx;
			position: relative;

			.radio radio {
				transform: scale(0.6);
			}
		}

		.tit {
			width: 140upx;
			font-size: 29upx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: rgba(102, 102, 102, 1);

		}

		.con {
			flex: 1;
			color: $font-color-dark;

			.selected-text {
				margin-right: 10upx;
			}
		}

		.bz-list {
			height: 40upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;

			text {
				display: inline-block;
				margin-right: 30upx;
			}
		}

		.con-list {
			flex: 1;
			display: flex;
			flex-direction: column;
			color: $font-color-dark;
			line-height: 40upx;

			text {
				font-size: 29upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #444444;

				text {
					color: #FF2F57;
				}
			}
		}

		.red {
			color: $uni-color-primary;
		}
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 20upx 30upx;
		background: #fff;
		margin-top: 16upx;

		.e-header {
			display: flex;
			align-items: center;
			height: 70upx;
			font-size: 29upx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: rgba(53, 53, 53, 1);

			.tit {
				font-size: 29upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(53, 53, 53, 1);
				margin-right: 4upx;
			}

			.tip {
				flex: 1;
				text-align: right;
				font-size: 25upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: #999999;

				text {
					color: #58CB9D;
				}
			}

			.icon-you {
				margin-left: 10upx;
			}
		}
	}

	.eva-box {
		display: flex;
		padding: 20upx 0;

		.portrait {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			border-radius: 100px;
		}

		.right {
			flex: 1;
			display: flex;
			/* flex-direction: column; */
			font-size: $font-base;
			color: $font-color-base;
			padding-left: 26upx;
			align-items: center;

			.level {
				padding: 6upx 8upx;
				background: rgba(77, 200, 151, 1);
				border-radius: 10upx;
				font-size: 19upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
				display: flex;
				justify-content: center;
				align-items: center;
				margin-left: 6upx;
			}
		}

	}


	.size {
		.con {
			font-size: $font-base;
			color: $font-color-dark;
			padding: 20upx 0;


			font-size: 25upx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: rgba(53, 53, 53, 1);
		}

		.bot {
			display: flex;
			justify-content: space-between;
			font-size: $font-sm;
			color: $font-color-light;
			font-size: 25upx;
			font-family: Microsoft YaHei;
			font-weight: 400;
			color: rgba(102, 102, 102, 1);
		}
	}

	.image-box {
		margin-top: 20upx;

		:nth-child(4n) {
			margin-right: 0;
		}

		image {
			width: 148upx;
			height: 149upx;
			margin-right: 29upx;
		}

	}


	/* 猜你喜欢 */
	.seckill-section {
		padding: 4upx 30upx 24upx;
		background: #fff;

		.s-header {
			display: flex;
			align-items: center;
			height: 92upx;
			line-height: 1;

			.title {
				font-size: 31upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(102, 102, 102, 1);
				;
			}

			.right {
				font-size: 21upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(130, 130, 130, 1);
				flex: 1;
				text-align: right;

			}

		}

		.floor-list {
			white-space: nowrap;
		}

		.scoll-wrapper {
			display: flex;
			align-items: flex-start;
		}

		.floor-item {
			margin-right: 26upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;
			width: 250upx;
			line-height: 1.8;
			border-radius: 6upx;
			position: relative;

			image {
				height: 250upx;
				width: 250upx;
				background: rgba(255, 255, 255, 1);
				box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.08);

			}

			.title {
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(68, 68, 68, 1);
				font-size: 23upx;
			}

			.price {
				font-size: 26upx;
				font-family: Adobe Heiti Std;
				font-weight: normal;
				color: rgba(240, 64, 111, 1);
			}

			.new {
				position: absolute;
				top: 0;
				left: 0;
				width: 98upx;
				height: 32upx;
				background: rgba(77, 200, 151, 1);
				font-size: 17upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
				text-align: center;
				line-height: 32upx;
			}

		}
	}

	/*详情*/
	.detail-desc {
		background: #fff;
		margin-top: 16upx;

		.d-header {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80upx;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			position: relative;

			text {
				padding: 0 20upx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 300upx;
				height: 0;
				content: '';
				border-bottom: 1px solid #ccc;
			}
		}
	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 10upx 30upx;

		.a-t {
			display: flex;

			image {
				width: 170upx;
				height: 170upx;
				flex-shrink: 0;
				margin-top: -40upx;
				border-radius: 8upx;
				;
			}

			.right {
				display: flex;
				flex-direction: column;
				padding-left: 24upx;
				font-size: $font-sm + 2upx;
				color: $font-color-base;
				line-height: 42upx;

				.price {
					font-size: $font-lg;
					color: $uni-color-primary;
					margin-bottom: 10upx;
				}

				.selected-text {
					margin-right: 10upx;
				}
			}
		}

		.attr-list {
			display: flex;
			flex-direction: column;
			font-size: $font-base + 2upx;
			color: $font-color-base;
			padding-top: 30upx;
			padding-left: 10upx;
		}

		.item-list {
			padding: 20upx 0 0;
			display: flex;
			flex-wrap: wrap;

			text {
				display: flex;
				align-items: center;
				justify-content: center;
				background: #eee;
				margin-right: 20upx;
				margin-bottom: 20upx;
				border-radius: 100upx;
				min-width: 60upx;
				height: 60upx;
				padding: 0 20upx;
				font-size: $font-base;
				color: $font-color-dark;
			}

			.selected {
				background: #fbebee;
				color: $uni-color-primary;
			}
		}
	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			.mask {
				animation: hidePopup 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			width: 100%;
			min-height: 40vh;
			border-radius: 10upx 10upx 0 0;
			background-color: #fff;

			.btn {
				height: 66upx;
				line-height: 66upx;
				border-radius: 100upx;
				background: $uni-color-primary;
				font-size: $font-base + 2upx;
				color: #fff;
				margin: 30upx auto 20upx;
			}
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		/* left: 30upx; */
		bottom: 0;
		z-index: 95;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 125upx;
		background: #1B1B1B;
		/* box-shadow: 0 0 20upx 0 rgba(0,0,0,.5); */
		/* border-radius: 16upx; */

		.p-b-btn {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: $font-sm;
			color: $font-color-base;
			width: 96upx;
			height: 80upx;

			.yticon {
				font-size: 40upx;
				line-height: 48upx;
				color: $font-color-light;
			}

			image {
				width: 50upx;
				height: 50upx;
			}

			&.active,
			&.active .yticon {
				color: $uni-color-primary;
			}

			.icon-fenxiang2 {
				font-size: 42upx;
				transform: translateY(-2upx);
			}

			.icon-shoucang {
				font-size: 46upx;
			}
		}

		.action-btn-group {
			display: flex;
			/* height: 57upx; */
			/* border-radius: 100px; */
			overflow: hidden;
			/* box-shadow: 0 20upx 40upx -16upx #fa436a;
			box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
			background: linear-gradient(to right, #ffac30,#fa436a,#F56C6C); */
			margin-left: 20upx;
			position: relative;

			.action-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 172upx;
				height: 68upx;
				background: rgba(77, 200, 151, 1);
				border-radius: 34upx;
				font-size: 25upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
				padding: 0;
				flex-wrap: wrap;

				text {
					display: inline-block;
					width: 100%;
					text-align: center;
					line-height: 1;
				}
			}

			.add-cart-btn {
				background: rgba(237, 61, 95, 1);
				font-size: 24upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
				margin-left: 16upx;
			}
		}
	}

	.activity-box {

		height: 161upx;
		background: rgba(240, 64, 111, 1);
		padding: 31upx 20upx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.left {
			.activity-name {
				display: block;
				font-size: 27upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
				text-align: left;
			}

			.price {
				font-size: 51upx;
				font-family: Microsoft YaHei;
				font-weight: bold;
				color: rgba(255, 255, 255, 1);
				text-align: left;

				text {
					font-size: 22rpx;
				}
			}
		}

		.right {
			flex: 1;
			text-align: right;

			.activity-desc {
				display: block;
				font-size: 25upx;
				font-family: Microsoft YaHei;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);

				.dso {
					width: 28rpx;
					height: 28rpx;
					background: rgba(255, 255, 255, 1);
					border-radius: 14rpx;
					text-align: center;
					font-size: 18rpx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(240, 64, 111, 1);
					line-height: 28rpx;
					display: inline-block;
					margin-left: 8rpx;
				}
			}

			.stock-box {
				display: inline-flex;
				align-items: center;
				justify-content: flex-end;

				.total-num {
					width: 100upx;
					height: 5upx;
					background: rgba(209, 55, 96, 1);
					border-radius: 3upx;
					position: relative;
					margin-right: 8upx;

					.now-num {
						position: absolute;
						width: 0;
						height: 100%;
						left: 0;
						top: 0;
						background: #fff;
					}
				}

				.justRemnant {
					font-size: 25upx;
					font-family: Microsoft YaHei;
					font-weight: 400;
					color: rgba(255, 255, 255, 1);
				}
			}
		}

	}
</style>
